package exsun.jt808.data.distribute_data.jt808;

import com.alibaba.fastjson.JSONObject;
import exsun.jt808.data.distribute_data.DistributeEntity;
import lombok.Data;

import java.text.SimpleDateFormat;
import java.util.Date;


public class QueryServerTimeResponse extends DistributeEntity {

    /**
     * 服务器时间
     */
    private Date serverTime;

    public Date getServerTime() {
        return serverTime;
    }

    public void setServerTime(Date serverTime) {
        this.serverTime = serverTime;
    }

    public JSONObject toJSONString() {
        JSONObject object = new JSONObject();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        object.put("serverTime",sdf.format(serverTime));
        object.put("versionId",versionId);
        object.put("distributeMsgTopic", distributeMsgTopic);
        object.put("msgId", msgId);
        object.put("devNo", devNo);
        object.put("requestId", requestId);
        object.put("userId", userId);
        object.put("userName", userName);
        object.put("distributeTime", sdf.format(distributeTime));
        object.put("serialNo", serialNo);
        object.put("response", response);
        return object;
    }
}
